package pages.navigator;

import pages.BasePage;
import pages.ComputersPage;
import pages.PageList;
import pages.PhonesPage;
import utils.WebDriverWrapper;

/**
 * Created with IntelliJ IDEA.
 * User: admin
 * Date: 10.06.14
 * Time: 18:04
 * To change this template use File | Settings | File Templates.
 */
public class MainNavigator{
    public static BasePage openPage(PageList page, WebDriverWrapper driver) throws Exception
    {
        switch (page)
        {
            case COMPUTERS:
                ComputersPage computersPage = new ComputersPage(driver);
                computersPage.open();
                return computersPage;
            case PHONES:
                PhonesPage phonesPage = new PhonesPage(driver);
                phonesPage.open();
                return phonesPage;
            default:
                throw new Exception();
        }
    }
}
